/**************************************************************************
 *                                                                        *
 *  JAVASCRIPT MENU HIGHLIGHTER v.1.5 (080929)                            *
 * --------------------------------------------                           *
 *                                                                        *
 *   to the current URL                                                   *
 * - works in IE, Firefox and Opera                                      *
 **************************************************************************/
function extractPageName(hrefString)
{
	var arr = hrefString.split('/');
	return  (arr.length<2) ? hrefString : arr[arr.length-2].toLowerCase() + arr[arr.length-1].toLowerCase();               
}

function setActiveMenu(arr, crtPage)
{
	for (var i=0; i<arr.length; i++)
	{
		if(extractPageName(arr[i].href) == crtPage)
		{
			if (arr[i].parentNode.tagName != "DIV")
			{
				arr[i].className = "highlight";
				arr[i].parentNode.className = "highlight";
			}
		}
	}
}

function setPage()
{
	hrefString = document.location.href ? document.location.href : document.location;

	if (document.getElementById("subModuleList")!=null)
		setActiveMenu(document.getElementById("subModuleList").getElementsByTagName("a"), extractPageName(hrefString));
}

window.onload = setPage; 

$(document).ready(function(){
    module = module_sugar_grp1;
        $('#subModuleList').find('a').each(function(){
           link = $(this).attr('href');
               if(link.match(module)){
                  $(this).parent().addClass('highlight');
               }
        });
});